// 请求响应参数（不包含data）
export interface Result {
  type: string;
  message: string;
}

// 请求响应参数（包含data）
export interface ResultData<T = any> extends Result {
  data: T;
}

// 分页响应参数
export interface ResPage<T> {
  content: T[];
  pages: number;
  total: number;
  current: number;
  size: number;
}

// 分页请求参数
export interface ReqPage {
  pageNum: number;
  pageSize: number;
}

// 文件上传模块
export namespace Upload {
  export interface ResFileInfo {
    name: string;
    path: string;
    signature: string;
  }
}

// 登录模块
export namespace Login {
  export interface DoLoginFrom {
    username: string;
    password: string;
    captchaId: string;
    captcha: string;
  }
  export interface Captcha {
    id: string;
    img: string;
  }
}
export namespace Goods {
  export interface Query {
    goodsName: string;
  }
  export interface ListData {
    goodsName: string;
    publishDate: string;
    id: string;
    goodsDefaultImg: string;
    memberPrice: number;
    marketPrice: number;
  }

  export interface GoodsEditFrom {
    id?: string;
    goodsName: string;
    goodsCarousel: string;
    goodsAttr: GoodsAttr;
    goodsInfoImg: string;
    goodsSpecs: Array<GoodsSpecs>;
  }

  export interface GoodsSpecs {
    k: string;
    v: string;
  }

  export interface GoodsAttr {
    attrName: string;
    attrValue: Array<AttrInfo>;
  }
  export interface AttrInfo {
    value: string;
    img: string;
    memberPrice: number;
    marketPrice: number;
    inventory: number;
  }
}
